package com.zcup.designer.construct.composite;

public abstract class Component {
    private String id;

    public Component(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    abstract void add(Component component);
    abstract void remove(Component component);
    abstract void display(int depth);
    public static String getLine(int depth){
        StringBuilder strLine = new StringBuilder();
        for (int i = 0; i < depth; i++) {
            strLine.append("-");
        }
        return strLine.toString();
    }
}
